package html

import (
	"net/http"
	"log"
	"fmt"
)

var H string;

func GetHtml(url string) string {
	return getUrl(url);
}

func getUrl(url string) string{
	client := &http.Client{}

	req, err := http.NewRequest("GET", url, nil)

	if err != nil {
		log.Fatal(err)
	}
	resp,_ := client.Do(req)
	buf := make([]byte, 1024)
	str := ""
	defer resp.Body.Close()
	for {
		n, _ :=resp.Body.Read(buf)
		if n != 0{
			str = str + string(buf)
		}else{
			break
		}
	}
	fmt.Println(buf)
	return str
}
